package com.momo.background.service.impl;

import com.momo.background.dao.mapping.DataCountMapper;
import com.momo.background.dto.DataCountDto;
import com.momo.background.service.DataCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DataCountServiceImpl implements DataCountService {

    @Autowired
    DataCountMapper dataCountMapper;

    @Override
    public DataCountDto GetCount() {
        DataCountDto dataCountDto = new DataCountDto();
        dataCountDto.setUserCount(dataCountMapper.UsersCount());
        dataCountDto.setRoomCount(dataCountMapper.RoomsCount());
        dataCountDto.setOrderCount(dataCountMapper.OrdersCount());
        dataCountDto.setNewsCount(dataCountMapper.NewsCount());
        dataCountDto.setHotelCount(dataCountMapper.HotelsCount());
        dataCountDto.setFeedbackCount(dataCountMapper.FeedBacksCount());
        dataCountDto.setCommentCount(dataCountMapper.CommentsCount());
        return dataCountDto;
    }
}
